package private1;

public class DayTester {
    public static void main(String[] args) {
    String[] wd={"日","一","二","三","四","五","六",};
    //接下来创建day的实例

    Day birthday=new Day(1997,5,26);


    System.out.println("你的生日"
            +birthday.getYear()+"年"
            +birthday.getMonth()+"月"
            +birthday.getDate()+"日是星期"
            +wd[birthday.dayOfWeek()]+"。");

            Day xDay=birthday;//复制birthday的引用目标

            xDay.set(2100,12,31);//修改birth的值


        System.out.println("birthday="+birthday.getYear()+"年"
                                      +birthday.getMonth()+"月"
                                        +birthday.getDate()+"日("
                                        +wd[birthday.dayOfWeek()]+")。"
                );
        System.out.println("xDay="+xDay.getYear()+"年"
                            +xDay.getMonth()+"月"
                            +xDay.getDate()+"日("
                            +wd[birthday.dayOfWeek()]+")。"
        );



        //类类型变量的比较
        Day day1 =new Day(2017,10,1);
        Day day2=new Day(2018,10 ,1);
        if (day1==day2)
            System.out.println("相等");
        else
            System.out.println("不相等");

    }
}
